Skip to content

[example] Add example for Swift Service Lifecycle #522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 44 commits into
base: main
Choose a base branch
from

Conversation

sebsto
Copy link
Contributor

@sebsto sebsto commented Jun 30, 2025

Now that task cancellation works, re publishing this PR with a new example for Swift Service Lifecycle

@sebsto sebsto self-assigned this Jun 30, 2025
@sebsto sebsto added the 🔨 semver/patch No public API change. label Jun 30, 2025
@sebsto sebsto changed the title [example] Add example for Swift Service Lifecycle [WIP] DO NOT MERGER - [example] Add example for Swift Service Lifecycle Jun 30, 2025
@sebsto sebsto changed the title [WIP] DO NOT MERGER - [example] Add example for Swift Service Lifecycle [WIP] DO NOT MERGE - [example] Add example for Swift Service Lifecycle Jun 30, 2025
@sebsto sebsto marked this pull request as draft July 15, 2025 10:51
@sebsto sebsto force-pushed the sebsto/servicelifecycle branch from 2432ed3 to 018d9ce Compare July 23, 2025 15:52
@sebsto sebsto changed the title [WIP] DO NOT MERGE - [example] Add example for Swift Service Lifecycle [example] Add example for Swift Service Lifecycle Jul 23, 2025
@sebsto sebsto marked this pull request as ready for review July 23, 2025 15:53
@sebsto sebsto requested review from adam-fowler and Copilot July 25, 2025 17:49
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a comprehensive example demonstrating Swift Service Lifecycle integration with AWS Lambda and PostgreSQL RDS, along with minor fixes to Docker command references and local server implementation.

  • Adds a complete ServiceLifecycle+Postgres example with AWS infrastructure setup
  • Fixes Docker command references in format checking scripts
  • Updates local server implementation to handle return values properly

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
scripts/check-format-linux.sh Fixed Docker command references from 'container' to 'docker'
Sources/AWSLambdaRuntime/Lambda+LocalServer.swift Updated return type handling and error management in local server
Examples/Streaming/samconfig.toml Added SAM configuration for streaming example
Examples/ServiceLifecycle+Postgres/* Complete new example with PostgreSQL integration, infrastructure templates, and documentation
.licenseignore Added .toml files to license ignore list
.github/workflows/pull_request.yml Added new example to CI workflow

@sebsto
Copy link
Contributor Author

sebsto commented Jul 26, 2025

@adam-fowler This is a new example.
I made a tiny change to the local HTTP server to avoid a crash + backtrace on CTRL-C, let me know if you think there is a more elegant way to solve that. (the root cause is a Channel I/O error on CTRL-C, looks like we still attempt to send data on a closed channel)

The rest is "just" a PostgreSQL + service lifecycle example. I provide a SAM template to setup the database in a secure way (private network, restrictive security groups, password stored in secret manager)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant